import csv
import numpy as np

def read_class_data(csv_name):
    with open(csv_name,'r') as file:
        reader = csv.reader(file)
        next(reader)
        return list(reader)

class1_data = read_class_data('class1.csv')
class2_data = read_class_data('class2.csv')
class3_data = read_class_data('class3.csv')

print(class1_data)
print(class2_data)
print(class3_data)

all_class_data = class1_data + class2_data + class3_data
all_class_scores = []
for data in all_class_data:
    all_class_scores.append(int(data[2]))
print(all_class_scores)


mean_scores = np.array(all_class_scores)
print("The mean is:",np.mean(mean_scores))

median_scores = np.array(all_class_scores)
print("The median is:",np.median(median_scores))

mode_scores= np.array(all_class_scores)
values,counts = np.unique(mode_scores,return_counts=True)
print("The mode is:",values[counts.argmax()])

variance_scores = np.array(all_class_scores)
print("The Variance is:",np.var(variance_scores))

formula_scores = np.array(all_class_scores)
print("The Standard Deviation is:",np.std(formula_scores))